package bod.engine.objs;

import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.util.Random;

import bod.Images;
import bod.engine.Engine;

public class Torch extends Object2D {

	public Torch(int x, int y) {
		super("Torch", x, y, 8, 16);
		this.gravity = false;
	}

	@Override
	public BufferedImage getImage() {
		BufferedImage img = new BufferedImage(8, 16,
				BufferedImage.TYPE_INT_ARGB);
		Graphics g = img.getGraphics();
		g.drawImage(Images.trch[0], 0, 0, 8, 16, null);
		if (Engine.isDay()) {
			int i = 1 + new Random().nextInt(3);
			g.drawImage(Images.trch[i], 0, 0, 8, 16, null);
		}
		g.dispose();
		return img;
	}

}
